#pragma once

#include <iostream>
#include <queue>
using namespace std;

#include "data_v.h"
#include "map_ip.h"

class ip_freq
{
private:
	priority_queue<uppg32::data_v> q;
public:

	ip_freq()
	{
	}

	ip_freq(uppg32::map_ip& mi)
	{
		for (auto it = mi.begin(); it != mi.end(); it++)
		{
			q.emplace(it->second);
		}
	}

	~ip_freq()
	{
	}

	void displayTop10()
	{
		for (int i = 0; i < 10; i++)
		{
			uppg32::data_v dv = q.top();
			cout << i + 1 << ": " << dv.ipnumber << " Connections : " << dv.numConnections << endl;
			q.pop();
		}
	}
};

